/* $Header: dma.h,v 2.2 01/10/02 10:30:17 przybyls Exp $ */


/***********************************************************************/
/* INCLUDE FILE NAME: dma.h                                           */
/* ==================                                                  */
/*                                                                     */
/* Author:  Bob Cook                                                   */
/*                                                                     */
/* COMMENT:                                                            */
/*          Include file containing all constants pertaining to        */
/*          using DMA with HPIB.                                       */
/*                                                                     */
/*                                                                     */
/*                                                                     */
/***********************************************************************/

#ifndef DMA_H
#define DMA_H

/*****************************/
/*   IFDEFS                  */
/*****************************/


/*****************************/
/*   SYMBOLIC CONSTANTS      */
/*****************************/


/* DMA states */
#define    DMA_IDLE_STATE   0
#define    DMA_TX_STATE     1
#define    DMA_RX_STATE     2

/* DEFINES FOR DMA STATUS REGISTER  */
#define    HPIB9914_INT      (BIT8)0x01
#define    DMA_RX_INT        (BIT8)0x40
#define    DMA_TX_COMPLETE   (BIT8)0x80
#define    DMA_TX_INT        (BIT8)0x08
#define    DMA_9914_OK       (BIT8)0x37


/* DEFINES FOR DMA CONTROL REGISTER  */
#define    DMA_EN        (BIT8)0x83
#define    DMA_DIS       (BIT8)0x00

#define    DMA_RX_MODE   (BIT8)0x08
#define    DMA_TX_MODE   (BIT8)0x00

#define    RCV_256       (BIT8)0x00
#define    RCV_512       (BIT8)0x10
#define    RCV_1024      (BIT8)0x20
#define    RCV_2048      (BIT8)0x30

/*****************************/
/*   TYPEDEFS                */
/*****************************/



/*****************************/
/*   DMA REGISTER LOCATION   */
/*****************************/


/*  DMA READ REGISTERS  */
#define DMA_COUNT_LSB     ((volatile U_INT8  *)0x0CFFE04)
#define DMA_COUNT_MSB     ((volatile U_INT8  *)0x0CFFE05)
#define DMA_STATUS           ((volatile BIT8 *)0x0CFFE07)


/*  DMA WRITE REGISTERS  */
#define DMA_CNT_LOC       ((volatile U_INT8  *)0x0CFFE03)
#define DMA_CTRL            ((volatile BIT8  *)0x0CFFE06)


/*****************************/
/*   MACROS                  */
/*****************************/


/*****************************/
/*   TYPEDEFS                */
/*****************************/




/*****************************/
/*   FUNCTION PROTOTYPES     */
/*****************************/


#endif
